package com.proxy;

/**
 * @ClassName UserServiceImpl
 * @Description TODO
 * @Author 2214361854
 * @Date 2022/3/5 13:46
 * @Version 1.0
 */
public class UserServiceImpl implements UserService{

    @Override
    public String login(String loginName, String passWord) {
        try {
            Thread.sleep(2000);
            if ("admin".equals(loginName) && "123456".equals(passWord)) {
                return "登录成功";
            }
            return "登录失败";
        }catch (Exception e) {
            e.printStackTrace();
            return "error";
        }
    }

    @Override
    public void selectUsers() {
        try {
            Thread.sleep(2000);
            System.out.println("查询成功");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    public boolean deleteUsers() {
        try {
            Thread.sleep(500);
            System.out.println("删除成功");
            return true;
        }catch (Exception e) {
            e.printStackTrace();
            return false;
        }
    }
}
